package com.ram.service.impl;

import com.ram.mapper.AssetInventoryMapper;
import com.ram.pojo.AssetInventory;
import com.ram.service.AssetInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class AssetInventoryServiceImpl implements AssetInventoryService {
    @Autowired
    private AssetInventoryMapper inventoryMapper;

    @Override
    public List<AssetInventory> list() {
        return inventoryMapper.list();
    }

    @Override
    public AssetInventory getById(Integer id) {
        return inventoryMapper.getById(id);
    }

    @Override
    public void add(AssetInventory inventory) {
        inventory.setCreateTime(LocalDateTime.now());
        inventoryMapper.insert(inventory);
    }

    @Override
    public void deleteById(Integer id) {
        inventoryMapper.deleteById(id);
    }
} 